package view;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTabbedPane;

import view.room.RoomPanel;

public class MainView extends JFrame{
	private static final long serialVersionUID = 1L;

	public MainView(){
		super("Quản Lí Khách Sạn - Demo");
		setMinimumSize(new Dimension(800, 600));
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
//		setMenuBar(new MenuTray());
		
		add(new ToolBar(), BorderLayout.NORTH);
//		add(new SideBar(), BorderLayout.WEST);
		
		JTabbedPane tabView = new JTabbedPane(JTabbedPane.LEFT);
		
		tabView.addTab("Lễ Tân", null);
		tabView.addTab("Phòng",		new RoomPanel());
		tabView.addTab("Đặt Phòng", new BookPanel());
		tabView.addTab("Thuê Phòng",new CheckinPanel());
		tabView.addTab("Trả phòng", new CheckoutPanel());
		tabView.addTab("Khách hàng", new CustomerPanel());
		String[] tabNames = {"Lễ Tân", "Phòng", "Dặt phòng", "Thuê phòng", "Trả phòng","Khách hàng"};
		for (int i=0; i<tabNames.length; i++){
			tabView.setTabComponentAt(i, new CustomTab(tabNames[i]));
		}
		add(tabView, BorderLayout.CENTER);
		setVisible(true);
		setExtendedState(JFrame.MAXIMIZED_BOTH);
	}
	
	class CustomTab extends JLabel{
		
		public CustomTab(String title){
			super(title);
			setPreferredSize(new Dimension(120, 30));
		}
	}
}
